home *** CD-ROM | disk | FTP | other *** search
/ Aminet 2 / Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso / Aminet / gfx / x11 / Xincludes_930531.lha / os-include_x11.lha / os-include / X11 / Xaw / TreeP.h < prev    next >
C/C++ Source or Header  |  1992-11-02  |  3KB  |  110 lines

  1. /*
  2.  * $XConsortium: TreeP.h,v 1.13 90/04/13 16:39:54 jim Exp $
  3.  *
  4.  * Copyright 1990 Massachusetts Institute of Technology
  5.  * Copyright 1989 Prentice Hall
  6.  *
  7.  * Permission to use, copy, modify, and distribute this software for any
  8.  * purpose and without fee is hereby granted, provided that the above
  9.  * copyright notice appear in all copies and that both the copyright notice
  10.  * and this permission notice appear in supporting documentation.
  11.  * 
  12.  * M.I.T., Prentice Hall and the authors disclaim all warranties with regard
  13.  * to this software, including all implied warranties of merchantability and
  14.  * fitness.  In no event shall M.I.T., Prentice Hall or the authors be liable
  15.  * for any special, indirect or cosequential damages or any damages whatsoever
  16.  * resulting from loss of use, data or profits, whether in an action of
  17.  * contract, negligence or other tortious action, arising out of or in
  18.  * connection with the use or performance of this software.
  19.  * 
  20.  * Authors:  Jim Fulton, MIT X Consortium,
  21.  *           based on a version by Douglas Young, Prentice Hall
  22.  * 
  23.  * This widget is based on the Tree widget described on pages 397-419 of
  24.  * Douglas Young's book "The X Window System, Programming and Applications 
  25.  * with Xt OSF/Motif Edition."  The layout code has been rewritten to use
  26.  * additional blank space to make the structure of the graph easier to see
  27.  * as well as to support vertical trees.
  28.  */
  29.  
  30.  
  31. #ifndef _XawTreeP_h
  32. #define _XawTreeP_h
  33.  
  34. #include <X11/Xaw/Tree.h>
  35.  
  36. typedef struct _TreeClassPart {
  37.     int ignore;
  38. } TreeClassPart;
  39.  
  40. typedef struct _TreeClassRec {
  41.     CoreClassPart core_class;
  42.     CompositeClassPart composite_class;
  43.     ConstraintClassPart constraint_class;
  44.     TreeClassPart tree_class;
  45. } TreeClassRec;
  46.  
  47. extern TreeClassRec treeClassRec;
  48.  
  49. typedef struct {
  50.     /* fields available through resources */
  51.     Dimension hpad;            /* hSpace/HSpace */
  52.     Dimension vpad;            /* vSpace/VSpace */
  53.     Dimension line_width;        /* lineWidth/LineWidth */
  54.     Pixel foreground;            /* foreground/Foreground */
  55.     XtGravity gravity;            /* gravity/Gravity */
  56.     Boolean auto_reconfigure;        /* autoReconfigure/AutoReconfigure */
  57.     /* private fields */
  58.     GC gc;                /* used to draw lines */
  59.     Widget tree_root;            /* hidden root off all children */
  60.     Dimension *largest;            /* list of largest per depth */
  61.     int n_largest;            /* number of elements in largest */
  62.     Dimension maxwidth, maxheight;    /* for shrink wrapping */
  63. } TreePart;
  64.  
  65.  
  66. typedef struct _TreeRec {
  67.     CorePart core;
  68.     CompositePart composite;
  69.     ConstraintPart constraint;
  70.     TreePart tree;
  71. }  TreeRec;
  72.  
  73.  
  74. /*
  75.  * structure attached to all children
  76.  */
  77. typedef struct _TreeConstraintsPart {
  78.     /* resources */
  79.     Widget parent;            /* treeParent/TreeParent */
  80.     GC gc;                /* treeGC/TreeGC */
  81.     /* private data */
  82.     Widget *children;
  83.     int n_children;
  84.     int max_children;
  85.     Dimension bbsubwidth, bbsubheight;    /* bounding box of sub tree */
  86.     Dimension bbwidth, bbheight;    /* bounding box including node */
  87.     Position x, y;
  88. } TreeConstraintsPart;
  89.  
  90. typedef struct _TreeConstraintsRec {
  91.    TreeConstraintsPart tree;
  92. } TreeConstraintsRec, *TreeConstraints;
  93.  
  94.  
  95. /*
  96.  * useful macros
  97.  */
  98.  
  99. #define TREE_CONSTRAINT(w) \
  100.                    ((TreeConstraints)((w)->core.constraints))
  101.  
  102. #define TREE_INITIAL_DEPTH 10        /* for allocating largest array */
  103. #define TREE_HORIZONTAL_DEFAULT_SPACING 20
  104. #define TREE_VERTICAL_DEFAULT_SPACING 6
  105.  
  106. #endif /* _XawTreeP_h */
  107.  
  108.  
  109.  
  110.